package io.afu.nginxhelper.dto.common.server;
import io.afu.nginxhelper.utils.CommonUtils;
import java.util.HashMap;
import java.util.Map;

public class FastCgi {

    public static final String KEY = "fastcgi_param";

    public Map<String,String> params;

    public FastCgi addParam(String key,String value) {
        if (this.params == null){
            this.params = new HashMap<>();
        }
        params.put(key,value);
        return this;
    }


    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }


    @Override
    public String toString() {
        return CommonUtils.makeCgiParams(params,FastCgi.KEY);
    }
}
